import sys

def main():
    '''
    input: links.txt
    (word, '<'? '>'? degl degr linkees..) -> ('words', 1)
                                             ('<', 1)      if '<' exist
                                             ('>', 1)      if '>' exist
    '''
    words = 0
    sharp_l = 0
    sharp_r = 0
    for line in sys.stdin:
        tokens = line.split()
        words += 1
        if '<' in tokens:
            sharp_l += 1
        if '>' in tokens:
            sharp_r += 1
    print 'words\t%d' % words
    print '<\t%d' % sharp_l
    print '>\t%d' % sharp_r

if __name__ == '__main__':
    main()
